/**
 * mutations
 */
export default {
    showLoading(state, txt = "正在加载") {
        state.showLoadingConfig.isShowLoading = true;
        state.showLoadingConfig.loadingText = txt;
    },
    hideLoading(state) {
        state.showLoadingConfig.isShowLoading = false;
    },
    showPreviewImage(state, obj) {
        if (Array.isArray(obj.urls)) {
            state.previewImageConfig.urls = obj.urls;
            state.previewImageConfig.isPreviewImage = true;
            state.previewImageConfig.current = obj.current;
        } else {
            throw new Error("请传入一个数组");
        }
    },
    hidePreviewImage(state) {
        state.previewImageConfig.isPreviewImage = false;
    },
    showMenu(state, config) {
        if (Array.isArray(config.itemList)) {
            state.slideMenuConfig.itemList = config.itemList;
            state.slideMenuConfig.isShowMenu = true;
            if (typeof config.success == "function") {
                state.slideMenuConfig.callBack = config.success;
            }
        }
        else {
            throw new Error("请传一个数组")
        }
    },
    hideMenu(state) {
        state.slideMenuConfig.isShowMenu = false;
    }
}